package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 月库数据表，用于存储历史月度数据
 * @TableName monthly_data
 */
@TableName(value ="monthly_data")
@Data
public class MonthlyData {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 数据月份
     */
    private Date dataMonth;

    /**
     * 国别ID
     */
    private Integer countryId;

    /**
     * 商品编码
     */
    private String commodityCode;

    /**
     * 地区ID
     */
    private Integer regionId;

    /**
     * 关区ID
     */
    private Integer customsId;

    /**
     * 贸易方式ID
     */
    private Integer tradeModeId;

    /**
     * 总金额
     */
    private BigDecimal totalAmount;

    /**
     * 数量
     */
    private BigDecimal quantity;

    /**
     * 币制(CNY/USD)
     */
    private String currencyType;

    /**
     * 数据类型(I:进口,E:出口,T:进出口)
     */
    private String dataType;

    /**
     * 是否备份数据(0:否,1:是)
     */
    private Integer isBackup;

    /**
     * 
     */
    private Date createTime;

    /**
     * 
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MonthlyData other = (MonthlyData) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDataMonth() == null ? other.getDataMonth() == null : this.getDataMonth().equals(other.getDataMonth()))
            && (this.getCountryId() == null ? other.getCountryId() == null : this.getCountryId().equals(other.getCountryId()))
            && (this.getCommodityCode() == null ? other.getCommodityCode() == null : this.getCommodityCode().equals(other.getCommodityCode()))
            && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId()))
            && (this.getCustomsId() == null ? other.getCustomsId() == null : this.getCustomsId().equals(other.getCustomsId()))
            && (this.getTradeModeId() == null ? other.getTradeModeId() == null : this.getTradeModeId().equals(other.getTradeModeId()))
            && (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getCurrencyType() == null ? other.getCurrencyType() == null : this.getCurrencyType().equals(other.getCurrencyType()))
            && (this.getDataType() == null ? other.getDataType() == null : this.getDataType().equals(other.getDataType()))
            && (this.getIsBackup() == null ? other.getIsBackup() == null : this.getIsBackup().equals(other.getIsBackup()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDataMonth() == null) ? 0 : getDataMonth().hashCode());
        result = prime * result + ((getCountryId() == null) ? 0 : getCountryId().hashCode());
        result = prime * result + ((getCommodityCode() == null) ? 0 : getCommodityCode().hashCode());
        result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode());
        result = prime * result + ((getCustomsId() == null) ? 0 : getCustomsId().hashCode());
        result = prime * result + ((getTradeModeId() == null) ? 0 : getTradeModeId().hashCode());
        result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getCurrencyType() == null) ? 0 : getCurrencyType().hashCode());
        result = prime * result + ((getDataType() == null) ? 0 : getDataType().hashCode());
        result = prime * result + ((getIsBackup() == null) ? 0 : getIsBackup().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", dataMonth=").append(dataMonth);
        sb.append(", countryId=").append(countryId);
        sb.append(", commodityCode=").append(commodityCode);
        sb.append(", regionId=").append(regionId);
        sb.append(", customsId=").append(customsId);
        sb.append(", tradeModeId=").append(tradeModeId);
        sb.append(", totalAmount=").append(totalAmount);
        sb.append(", quantity=").append(quantity);
        sb.append(", currencyType=").append(currencyType);
        sb.append(", dataType=").append(dataType);
        sb.append(", isBackup=").append(isBackup);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}